package com.sitanyun.merchant.guide.weiht;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 *  *@content:活动结束管理类
 * Created by jzl
 * on 2022/2/18.
 */
public class ActivityFinishUtil {
    private static List<Activity> activityList = new ArrayList<>();

    public static void addActivity(Activity activity){
        activityList.add(activity);
    }

    public static void removeActivity(Activity activity){
        activityList.remove(activity);
    }

    public static void finishOtherAllActivity(Activity activity){
        for (Activity item : activityList){
            if (item == activity){
                continue;
            }
            item.finish();
        }
    }

    public static void finishAllActivity(){
        for (Activity item : activityList){
            item.finish();
        }
    }

}
